//This is a cmocean colormap
//All credit to Kristen Thyng
//This colormap is under the MIT License
//All cmocean colormaps are available at https://github.com/matplotlib/cmocean/tree/master/cmocean/rgb


namespace ScottPlot.Colormaps;

public class Speed : IColormap
{
    public string Name => "Speed";
    readonly CustomPalette Colormap;
    public Color GetColor(double position) => Colormap.GetColor(position);

    public Speed()
    {
        Color[] colors =
        [
            new( 255, 253, 205 ),
            new( 254, 252, 203 ),
            new( 254, 250, 201 ),
            new( 253, 249, 199 ),
            new( 252, 248, 197 ),
            new( 252, 247, 194 ),
            new( 251, 246, 192 ),
            new( 250, 244, 190 ),
            new( 249, 243, 188 ),
            new( 249, 242, 186 ),
            new( 248, 241, 184 ),
            new( 247, 240, 182 ),
            new( 247, 238, 180 ),
            new( 246, 237, 177 ),
            new( 246, 236, 175 ),
            new( 245, 235, 173 ),
            new( 244, 234, 171 ),
            new( 243, 233, 169 ),
            new( 243, 231, 167 ),
            new( 242, 230, 165 ),
            new( 241, 229, 162 ),
            new( 241, 228, 160 ),
            new( 240, 227, 158 ),
            new( 239, 226, 156 ),
            new( 239, 225, 154 ),
            new( 238, 223, 152 ),
            new( 237, 222, 150 ),
            new( 237, 221, 147 ),
            new( 236, 220, 145 ),
            new( 235, 219, 143 ),
            new( 234, 218, 141 ),
            new( 234, 217, 139 ),
            new( 233, 216, 137 ),
            new( 232, 215, 134 ),
            new( 231, 214, 132 ),
            new( 231, 213, 130 ),
            new( 230, 212, 128 ),
            new( 229, 211, 126 ),
            new( 228, 210, 123 ),
            new( 227, 208, 121 ),
            new( 227, 207, 119 ),
            new( 226, 206, 117 ),
            new( 225, 205, 115 ),
            new( 224, 205, 113 ),
            new( 223, 204, 110 ),
            new( 222, 203, 108 ),
            new( 221, 202, 106 ),
            new( 220, 201, 104 ),
            new( 219, 200, 102 ),
            new( 218, 199, 100 ),
            new( 217, 198, 97 ),
            new( 216, 197, 95 ),
            new( 215, 196, 93 ),
            new( 214, 195, 91 ),
            new( 213, 194, 89 ),
            new( 212, 193, 87 ),
            new( 211, 193, 85 ),
            new( 210, 192, 83 ),
            new( 209, 191, 81 ),
            new( 208, 190, 79 ),
            new( 206, 189, 76 ),
            new( 205, 189, 74 ),
            new( 204, 188, 72 ),
            new( 203, 187, 70 ),
            new( 201, 186, 69 ),
            new( 200, 185, 67 ),
            new( 199, 185, 65 ),
            new( 197, 184, 63 ),
            new( 196, 183, 61 ),
            new( 195, 183, 59 ),
            new( 193, 182, 57 ),
            new( 192, 181, 55 ),
            new( 190, 180, 54 ),
            new( 189, 180, 52 ),
            new( 187, 179, 50 ),
            new( 186, 178, 48 ),
            new( 184, 178, 47 ),
            new( 183, 177, 45 ),
            new( 181, 176, 43 ),
            new( 180, 176, 42 ),
            new( 178, 175, 40 ),
            new( 177, 174, 39 ),
            new( 175, 174, 37 ),
            new( 173, 173, 35 ),
            new( 172, 173, 34 ),
            new( 170, 172, 32 ),
            new( 169, 171, 31 ),
            new( 167, 171, 30 ),
            new( 165, 170, 28 ),
            new( 164, 169, 27 ),
            new( 162, 169, 25 ),
            new( 160, 168, 24 ),
            new( 159, 168, 23 ),
            new( 157, 167, 21 ),
            new( 155, 166, 20 ),
            new( 154, 166, 19 ),
            new( 152, 165, 18 ),
            new( 150, 165, 16 ),
            new( 149, 164, 15 ),
            new( 147, 163, 14 ),
            new( 145, 163, 13 ),
            new( 143, 162, 12 ),
            new( 142, 162, 11 ),
            new( 140, 161, 10 ),
            new( 138, 160, 9 ),
            new( 136, 160, 8 ),
            new( 135, 159, 8 ),
            new( 133, 159, 7 ),
            new( 131, 158, 7 ),
            new( 129, 157, 6 ),
            new( 128, 157, 6 ),
            new( 126, 156, 6 ),
            new( 124, 156, 6 ),
            new( 122, 155, 6 ),
            new( 121, 154, 6 ),
            new( 119, 154, 6 ),
            new( 117, 153, 6 ),
            new( 115, 153, 6 ),
            new( 113, 152, 6 ),
            new( 112, 151, 7 ),
            new( 110, 151, 7 ),
            new( 108, 150, 7 ),
            new( 106, 149, 8 ),
            new( 104, 149, 9 ),
            new( 102, 148, 9 ),
            new( 101, 148, 10 ),
            new( 99, 147, 11 ),
            new( 97, 146, 11 ),
            new( 95, 146, 12 ),
            new( 93, 145, 13 ),
            new( 92, 144, 14 ),
            new( 90, 144, 15 ),
            new( 88, 143, 15 ),
            new( 86, 142, 16 ),
            new( 84, 142, 17 ),
            new( 82, 141, 18 ),
            new( 81, 140, 18 ),
            new( 79, 140, 19 ),
            new( 77, 139, 20 ),
            new( 75, 138, 21 ),
            new( 73, 138, 22 ),
            new( 72, 137, 22 ),
            new( 70, 136, 23 ),
            new( 68, 136, 24 ),
            new( 66, 135, 25 ),
            new( 64, 134, 25 ),
            new( 63, 133, 26 ),
            new( 61, 133, 27 ),
            new( 59, 132, 28 ),
            new( 57, 131, 28 ),
            new( 56, 131, 29 ),
            new( 54, 130, 30 ),
            new( 52, 129, 30 ),
            new( 50, 128, 31 ),
            new( 49, 127, 32 ),
            new( 47, 127, 32 ),
            new( 45, 126, 33 ),
            new( 44, 125, 33 ),
            new( 42, 124, 34 ),
            new( 40, 124, 35 ),
            new( 39, 123, 35 ),
            new( 37, 122, 36 ),
            new( 36, 121, 36 ),
            new( 34, 120, 37 ),
            new( 33, 120, 37 ),
            new( 31, 119, 38 ),
            new( 30, 118, 38 ),
            new( 28, 117, 39 ),
            new( 27, 116, 39 ),
            new( 26, 115, 39 ),
            new( 24, 115, 40 ),
            new( 23, 114, 40 ),
            new( 22, 113, 41 ),
            new( 21, 112, 41 ),
            new( 19, 111, 41 ),
            new( 18, 110, 42 ),
            new( 17, 109, 42 ),
            new( 16, 108, 42 ),
            new( 15, 108, 43 ),
            new( 15, 107, 43 ),
            new( 14, 106, 43 ),
            new( 13, 105, 43 ),
            new( 13, 104, 43 ),
            new( 12, 103, 44 ),
            new( 12, 102, 44 ),
            new( 11, 101, 44 ),
            new( 11, 100, 44 ),
            new( 11, 99, 44 ),
            new( 11, 99, 44 ),
            new( 11, 98, 45 ),
            new( 11, 97, 45 ),
            new( 11, 96, 45 ),
            new( 11, 95, 45 ),
            new( 11, 94, 45 ),
            new( 12, 93, 45 ),
            new( 12, 92, 45 ),
            new( 12, 91, 45 ),
            new( 13, 90, 45 ),
            new( 13, 89, 45 ),
            new( 14, 88, 45 ),
            new( 14, 87, 45 ),
            new( 15, 86, 44 ),
            new( 15, 85, 44 ),
            new( 16, 84, 44 ),
            new( 16, 84, 44 ),
            new( 16, 83, 44 ),
            new( 17, 82, 44 ),
            new( 17, 81, 44 ),
            new( 18, 80, 43 ),
            new( 18, 79, 43 ),
            new( 19, 78, 43 ),
            new( 19, 77, 43 ),
            new( 20, 76, 42 ),
            new( 20, 75, 42 ),
            new( 20, 74, 42 ),
            new( 21, 73, 42 ),
            new( 21, 72, 41 ),
            new( 22, 71, 41 ),
            new( 22, 70, 41 ),
            new( 22, 69, 40 ),
            new( 23, 68, 40 ),
            new( 23, 67, 39 ),
            new( 23, 66, 39 ),
            new( 23, 65, 39 ),
            new( 24, 64, 38 ),
            new( 24, 63, 38 ),
            new( 24, 63, 37 ),
            new( 24, 62, 37 ),
            new( 25, 61, 36 ),
            new( 25, 60, 36 ),
            new( 25, 59, 35 ),
            new( 25, 58, 35 ),
            new( 25, 57, 34 ),
            new( 25, 56, 34 ),
            new( 25, 55, 33 ),
            new( 25, 54, 33 ),
            new( 25, 53, 32 ),
            new( 25, 52, 31 ),
            new( 25, 51, 31 ),
            new( 25, 50, 30 ),
            new( 25, 49, 30 ),
            new( 25, 48, 29 ),
            new( 25, 47, 28 ),
            new( 25, 46, 28 ),
            new( 25, 45, 27 ),
            new( 25, 44, 26 ),
            new( 25, 44, 25 ),
            new( 25, 43, 25 ),
            new( 25, 42, 24 ),
            new( 24, 41, 23 ),
            new( 24, 40, 23 ),
            new( 24, 39, 22 ),
            new( 24, 38, 21 ),
            new( 24, 37, 20 ),
            new( 23, 36, 19 ),
            new( 23, 35, 19 ),
        ];

        Colormap = new CustomPalette(colors);
    }
}

